
package file;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

/**
 * <br>
 * Copyright: Copyright (c) 2001-2008<br>
 * Company: E885 Group
 * 
 * @author Eric.Kao(gau168.gau@msa.hinet.net)
 * @version 1.0
 */

public class TestFilePath
{

	/**
	 * @throws IOException 
	 * @throws URISyntaxException 
	 * 
	 */
	public TestFilePath() throws IOException, URISyntaxException
	{
		File file = new File( "C:/Program Files/test.txt" );
		//File file = new File( new URI( "file:///C:/Program%20Files/test.txt" ) );
		//File file = new File( new URI( "file:///D:/temp/test.txt" ) );

		FileInputStream fis = new FileInputStream( file );

		byte[] content = new byte[ fis.available() ];

		fis.read( content );

		String str = new String( content );

		System.out.println( "str:[" + str + "]" );
	}

	/**
	 * @param args
	 * @throws URISyntaxException 
	 */
	public static void main( String[] args ) throws URISyntaxException
	{
		try
		{
			new TestFilePath();
		}
		catch( IOException e )
		{
			e.printStackTrace();
		}
	}

}
